home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2005 March / Gamestar_71_2005-03_dvd.iso / Dema / willofsteel_demo.exe / {app} / Data / Shaders / default00.fx < prev    next >
Text File  |  2004-10-23  |  6KB  |  242 lines

  1. float4x4 WorldViewProjection;
  2. float4x4 ShadowViewProjection;
  3. float4x4 TextureMatrix;
  4. float4x4 WorldMatrix;
  5. float4x4 ViewIT;
  6.  
  7. texture AlphaTexture;
  8. texture DiffuseTexture;
  9. texture ShadowTexture;
  10. texture CloudsTexture;
  11. texture FogOfWar;
  12. texture BurnedTexture;
  13. float4  BurnFactor     = { 0.4, 0.4, 0.4, 0.4 };
  14.  
  15. float3 LightDirection = { 0.0f, 0.0f, 0.0f };
  16. float3 SunColor       = { 1., 0.86, .70  };
  17. float3 Ambient        = { 0.24, 0.12, 0.04 };
  18. float4 FogScale          = { 0.001953125, 0.001953125, 0.001953125, 0.001953125 };    
  19. float4 ZBias          = { 0.0, 0.0, 0.0, -0.004 };
  20. float4 ShadowOffset;
  21. float4 CloudUVShift    = { 0.0, 0.0, 0.0, 0.0 };
  22. float4 CloudScale      = { 0.01, 0.01, 0.01, 0.01 };
  23. float4 BlinkFactor     = { 0.0, 0.0, 0.0, 0.0 };
  24.  
  25. technique Technique0
  26. {
  27.     pass Pass0
  28.     {
  29.         Texture[0]               = (DiffuseTexture);
  30.         
  31.         ColorOp[0]                 = MODULATE;
  32.         ColorArg1[0]             = TEXTURE;
  33.         ColorArg2[0]             = DIFFUSE;
  34.         AlphaOp[0]                 = DISABLE;
  35.  
  36.         Texture[1]               = (FogOfWar);
  37.         ColorOp[1]                 = MODULATE;
  38.         ColorArg1[1]             = TEXTURE;
  39.         ColorArg2[1]             = CURRENT;
  40.         ColorOp[2]                 = DISABLE;
  41.  
  42.         VertexShaderConstant[0]   = <WorldViewProjection>;
  43.         VertexShaderConstant[12]  = <WorldMatrix>;
  44.         VertexShaderConstant[16]  = <ViewIT>;
  45.         VertexShaderConstant[26]  = <BlinkFactor>;
  46.         VertexShaderConstant[27]  = <FogScale>;
  47.         VertexShaderConstant[30]  = <LightDirection>;
  48.         VertexShaderConstant[32]  = <SunColor>;
  49.         VertexShaderConstant[28]  = <Ambient>;
  50.  
  51.         ALPHABLENDENABLE = FALSE;
  52.         ALPHATESTENABLE  = FALSE;
  53.  
  54.         VertexShader =
  55.         decl
  56.         {
  57.             stream 0;
  58.             float v0[3];       // Position
  59.             float v3[3];       // Normal
  60.             float v6[2];       // Texture coord1
  61.         }
  62.         asm
  63.         {
  64.             vs_1_1
  65.  
  66.             dcl_position v0
  67.             dcl_normal v3
  68.             dcl_texcoord0  v6
  69.  
  70.             m4x4  oPos, v0, c0
  71.             m4x4  r0, v0, c12
  72.             mul   r0, r0, c27
  73.             mov   oT1.x, r0.x      
  74.             mov   oT1.y, r0.z      
  75.             mov   oT0, v6          
  76.             dp3   r0, -v3, c30     
  77.             mov   r1, c32     
  78.             add   r1, r1, c26
  79.             mad   oD0, r0, r1, c28
  80.         };
  81.  
  82.         PixelShader = NULL;
  83.     }
  84. }
  85.  
  86.  
  87. // rendering u shadow mapu
  88. technique Technique1
  89. {
  90.     pass Pass0
  91.     {
  92.         Lighting         = FALSE;
  93.         VertexShader = NULL;
  94.         PixelShader = NULL;
  95.     }
  96. }
  97.  
  98.  
  99. technique Technique2
  100. {
  101.     pass Pass0
  102.     {
  103.         Texture[0]               = (DiffuseTexture);
  104.         ColorOp[0]                 = MODULATE;
  105.         ColorArg1[0]             = TEXTURE;
  106.         ColorArg2[0]             = DIFFUSE;
  107.         AlphaOp[0]                 = SELECTARG1;
  108.         AlphaArg1[0]             = TEXTURE;
  109.  
  110.         Texture[1]               = (FogOfWar);
  111.         ColorOp[1]                 = MODULATE;
  112.         ColorArg1[1]             = TEXTURE;
  113.         ColorArg2[1]             = CURRENT;
  114.         ColorOp[2]                 = DISABLE;
  115.         AlphaOp[1]                 = DISABLE;
  116.  
  117.         VertexShaderConstant[0]   = <WorldViewProjection>;
  118.         VertexShaderConstant[12]  = <WorldMatrix>;
  119.         VertexShaderConstant[16]  = <ViewIT>;
  120.         VertexShaderConstant[26]  = <BlinkFactor>;
  121.         VertexShaderConstant[27]  = <FogScale>;
  122.         VertexShaderConstant[30]  = <LightDirection>;
  123.         VertexShaderConstant[32]  = <SunColor>;
  124.         VertexShaderConstant[28]  = <Ambient>;
  125.  
  126.         ALPHABLENDENABLE = TRUE;
  127.         SRCBLEND         = SRCALPHA;
  128.         DESTBLEND        = INVSRCALPHA;
  129.         ALPHATESTENABLE  = TRUE;
  130.         ALPHAFUNC        = GREATER;
  131.         ALPHAREF         = 1;
  132.  
  133.         VertexShader =
  134.         decl
  135.         {
  136.             stream 0;
  137.             float v0[3];       // Position
  138.             float v3[3];       // Normal
  139.             float v6[2];       // Texture coord1
  140.         }
  141.         asm
  142.         {
  143.             vs_1_1
  144.  
  145.             dcl_position v0
  146.             dcl_normal v3
  147.             dcl_texcoord0  v6
  148.  
  149.             m4x4  oPos, v0, c0
  150.             m4x4  r0, v0, c12
  151.             mul   r0, r0, c27
  152.             mov   oT1.x, r0.x      
  153.             mov   oT1.y, r0.z      
  154.             mov   oT0, v6          
  155.             dp3   r0, -v3, c30     
  156.             mov   r1, c32     
  157.             add   r1, r1, c26
  158.             mad   oD0, r0, r1, c28
  159.         };
  160.         
  161.         PixelShader = NULL;
  162.     }
  163. }
  164.  
  165.  
  166. // rendering u shadow mapu
  167. technique Technique3
  168. {
  169.     pass Pass0
  170.     {
  171.         VertexShader = NULL;
  172.         PixelShader = NULL;
  173.     }
  174. }
  175.  
  176.  
  177. technique Technique4
  178. {
  179.     pass Pass0
  180.     {
  181.         Texture[0]               = (DiffuseTexture);
  182.         ColorOp[0]                 = MODULATE;
  183.         ColorArg1[0]             = TEXTURE;
  184.         ColorArg2[0]             = DIFFUSE;
  185.         AlphaOp[0]                 = SELECTARG1;
  186.         AlphaArg1[0]             = TEXTURE;
  187.  
  188.         Texture[1]               = (FogOfWar);
  189.         ColorOp[1]                 = MODULATE;
  190.         ColorArg1[1]             = TEXTURE;
  191.         ColorArg2[1]             = CURRENT;
  192.         ColorOp[2]                 = DISABLE;
  193.         AlphaOp[1]                 = DISABLE;
  194.  
  195.         VertexShaderConstant[0]   = <WorldViewProjection>;
  196.         VertexShaderConstant[12]  = <WorldMatrix>;
  197.         VertexShaderConstant[16]  = <ViewIT>;
  198.         VertexShaderConstant[26]  = <BlinkFactor>;
  199.         VertexShaderConstant[27]  = <FogScale>;
  200.         VertexShaderConstant[30]  = <LightDirection>;
  201.         VertexShaderConstant[32]  = <SunColor>;
  202.         VertexShaderConstant[28]  = <Ambient>;
  203.  
  204.         ALPHABLENDENABLE = TRUE;
  205.         SRCBLEND         = SRCALPHA;
  206.         DESTBLEND        = INVSRCALPHA;
  207.         ALPHATESTENABLE  = TRUE;
  208.         ALPHAFUNC        = GREATER;
  209.         ALPHAREF         = 1;
  210.  
  211.         VertexShader =
  212.         decl
  213.         {
  214.             stream 0;
  215.             float v0[3];       // Position
  216.             float v3[3];       // Normal
  217.             float v6[2];       // Texture coord1
  218.         }
  219.         asm
  220.         {
  221.             vs_1_1
  222.  
  223.             dcl_position v0
  224.             dcl_normal v3
  225.             dcl_texcoord0  v6
  226.  
  227.             m4x4  oPos, v0, c0
  228.             m4x4  r0, v0, c12
  229.             mul   r0, r0, c27
  230.             mov   oT1.x, r0.x      
  231.             mov   oT1.y, r0.z      
  232.             mov   oT0, v6          
  233.             dp3   r0, -v3, c30     
  234.             mov   r1, c32     
  235.             add   r1, r1, c26
  236.             mad   oD0, r0, r1, c28
  237.         };
  238.         
  239.         PixelShader = NULL;
  240.     }
  241. }
  242.